package com.wuxin.controller.admin;


import com.wuxin.entity.UserLoginRecord;
import com.wuxin.result.Result;
import com.wuxin.service.UserLoginRecordService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户登录记录表 前端控制器
 * </p>
 *
 * @author wuxin
 * @since 2025-01-13
 */
@RestController
@RequestMapping("/admin/core/userLoginRecord")
public class UserLoginRecordController {

    @Autowired
    private UserLoginRecordService userLoginRecordService;

    //http://localhost/admin/core/userLoginRecord/listTop50/16
    @ApiOperation("查看用户登录日志")
    @GetMapping("/listTop50/{userId}")
    public Result listTop50(
            @ApiParam(value = "用户id",required = true)
            @PathVariable Long userId
    ){
        List<UserLoginRecord> userLoginRecordList = userLoginRecordService.listTop50(userId);
        return Result.ok().data("list",userLoginRecordList);
    }


}

